/*
 * ClienteDao.java
 *
 * Created on 4 de Junho de 2007, 23:19
 *
 */

package net.sf.jOpinionPoll.dao.jpa;

import java.util.List;

import net.sf.jOpinionPoll.dao.AlternativaDao;
import net.sf.jOpinionPoll.entity.Alternativa;

/**
 *
 * @author erico
 */
public class AlternativaDaoJpa extends DaoJpa implements AlternativaDao {

	/** Creates a new instance of ClienteDao */
    public AlternativaDaoJpa() {
    }

    private DaoJpaHelper<Alternativa> getDaoJpaHelper() {
    	return new DaoJpaHelper<Alternativa>(getEntityManager(), Alternativa.class);
    }

	@Override
	public void add(Alternativa newInstance) {
		getDaoJpaHelper().add(newInstance);
	}

	@Override
	public int count() {
		return getDaoJpaHelper().count();
	}

	@Override
	public Alternativa findByPk(Object primaryKey) {
		return getDaoJpaHelper().findByPk(primaryKey);
	}

	@Override
	public List<Alternativa> list(int firstResult, int maxResults) {
		return getDaoJpaHelper().list(firstResult, maxResults);
	}

	@Override
	public void remove(Alternativa alternativa) {
		getDaoJpaHelper().remove(alternativa);
	}

	@Override
	public void set(Alternativa alternativa) {
		getDaoJpaHelper().set(alternativa);
	}
}